package com.qf.service.impl;

import com.qf.mapper.ShopMapper;
import com.qf.pojo.Shop;
import com.qf.service.ShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 商品的业务接口实现
 */
@Service
@Transactional //事务
public class ShopServiceImpl implements ShopService {
    //注入mapper
    @Autowired
    private ShopMapper shopMapper;
    /**
     * 获取所有商品
     * @return
     */
    @Override
    public List<Shop> getAllShop() {
        System.out.println("正在查询所有商品");
        List<Shop> list = shopMapper.findAll();
        if (list!=null){
            return list;
        }
        return null;
    }
}
